<%--
  Created by IntelliJ IDEA.
  User: hiugiak
  Date: 2018/11/28
  Time: 10:18 AM
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<jsp:useBean id="now" class="java.util.Date" />
<html>
<head>
    <jsp:include page="../../includes/framework-headers.jsp"/>
    <jsp:include page="../../includes/framework-navbar-admin.jsp">
        <jsp:param name="navSelection" value="1-2"/>
    </jsp:include>

    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/components/notify.almost-flat.min.css">
    <script src="${pageContext.request.contextPath}/js/uikit/components/notify.min.js"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/components/datepicker.almost-flat.min.css">
    <script src="${pageContext.request.contextPath}/js/uikit/components/datepicker.min.js"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/components/form-select.almost-flat.min.css">
    <script src="${pageContext.request.contextPath}/js/uikit/components/form-select.min.js"></script>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/components/accordion.min.css">
    <script src="${pageContext.request.contextPath}/js/uikit/components/accordion.min.js"></script>

    <script src="${pageContext.request.contextPath}/js/admin/account_management.js"></script>
    <script src="${pageContext.request.contextPath}/js/admin/account_search_box.js"></script>
    <script src="${pageContext.request.contextPath}/js/admin/modify_account.js"></script>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.17.0/jquery.validate.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.17.0/additional-methods.min.js"></script>
    <script src="${pageContext.request.contextPath}/js/jquery_plugins/jquery.serializejson.js"></script>

    <title>毕业设计指导网站 - 用户管理</title>
</head>
<body>
<div class="gpg-middle">
    <div class="uk-container uk-container-center">
        <div class="uk-grid" data-uk-grid-margin>
            <jsp:include page="../../includes/framework-nav-panel-admin.jsp">
                <jsp:param name="navSelection" value="1-2"/>
            </jsp:include>
            <div class="uk-width-medium-3-4">
                <!-- 主体内容 -->
                <article class="uk-article">
                    <h1 class="uk-article-title">修改用户</h1>
                    <%--<hr class="uk-article-divider">--%>
                    <div class="uk-accordion" data-uk-accordion>

                        <h3 class="uk-accordion-title">模糊查询</h3>
                        <div class="uk-accordion-content">
                            <div class="uk-container uk-container-center">
                                <form class="uk-form uk-margin" id="form_search_condition">
                                    <fieldset>
                                        <div class="uk-grid" data-uk-margin>
                                            <div class="uk-width-medium-1-2">
                                                <label class="uk-form-label" for="search_user_type">用户类型</label>
                                                <div class="uk-form-controls">
                                                    <select name="userType" class="uk-width-1-1" id="search_user_type">
                                                        <option value="S">学生</option>
                                                        <option value="T">教师</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="uk-width-medium-1-2">
                                                <label class="uk-form-label" for="search_account_no">用户名</label>
                                                <div class="uk-form-controls">
                                                    <input name="number:string" class="uk-width-1-1" type="text" id="search_account_no" maxlength="10"
                                                    placeholder="学号或工号">
                                                </div>
                                            </div>
                                            <div class="uk-width-medium-1-2">
                                                <label class="uk-form-label" for="search_profile_name">姓名</label>
                                                <div class="uk-form-controls">
                                                    <input name="name:string" class="uk-width-1-1" type="text" id="search_profile_name" maxlength="50">
                                                </div>
                                            </div>
                                            <div class="uk-width-medium-1-2">
                                                <label class="uk-form-label" for="search_id_number">身份证号码</label>
                                                <div class="uk-form-controls">
                                                    <input name="idNumber:string" class="uk-width-1-1" type="text" id="search_id_number" maxlength="18"
                                                    placeholder="输入数字与大写字母 X ">
                                                </div>
                                            </div>
                                        </div>
                                    </fieldset>
                                </form>
                                <div class="uk-grid">
                                    <div class="uk-align-center">
                                        <div class="uk-button-group">
                                            <button class="uk-button uk-button-primary" id="btn_search">搜索</button>
                                            <button class="uk-button uk-button-primary" id="btn_reset">重置</button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <hr>

                    <div id="dialog" class="uk-modal">
                        <div class="uk-modal-dialog">
                            <button type="button" class="uk-modal-close uk-close"></button>
                            <div class="uk-modal-header">
                                <h2>用户信息</h2>
                            </div>
                            <div class="uk-overflow-container">
                                <input type="number" id="account_index" hidden>
                                <form class="uk-form uk-margin" id="form_account_info">
                                    <fieldset>
                                        <div class="uk-grid" data-uk-margin id="account_data">

                                            <div class="uk-width-medium-1-2">
                                                <label class="uk-form-label" for="account_user_type">用户类型</label>
                                                <div class="uk-form-controls">
                                                    <select name="userType" class="uk-width-1-1" id="account_user_type" disabled>
                                                        <option value="S">学生</option>
                                                        <option value="T">教师</option>
                                                    </select>
                                                </div>
                                            </div>

                                        </div>
                                    </fieldset>
                                </form>

                                <hr class="uk-grid-divider">

                                <form class="uk-form uk-margin" id="form_student_info">
                                    <fieldset>

                                        <div class="uk-grid" data-uk-margin id="student_profile">
                                            <div class="uk-width-medium-1-2">
                                                <label class="uk-form-label" for="student_no">学号</label>
                                                <div class="uk-form-controls">
                                                    <input name="studentNumber:string" class="uk-width-1-1" type="text" id="student_no" maxlength="10" disabled>
                                                </div>
                                            </div>

                                            <div class="uk-width-medium-1-2">
                                                <label class="uk-form-label" for="student_name">姓名</label>
                                                <div class="uk-form-controls">
                                                    <input name="name:string" class="uk-width-1-1" type="text" id="student_name" maxlength="50">
                                                </div>
                                            </div>

                                            <div class="uk-width-medium-1-2">
                                                <label class="uk-form-label" for="student_birth_date">出生日期</label>
                                                <div class="uk-form-controls">
                                                    <input name="birthDate:string" class="uk-width-1-1" type=""
                                                           id="student_birth_date"
                                                           data-uk-datepicker="{weekstart: 0, format: 'YYYY-MM-DD', maxDate: 0}">
                                                </div>
                                            </div>

                                            <div class="uk-width-medium-1-2">
                                                <label class="uk-form-label" for="student_gender">性别</label>
                                                <div class="uk-form-controls">
                                                    <select name="gender:string" class="uk-width-1-1" id="student_gender">
                                                        <option value="M">男</option>
                                                        <option value="F">女</option>
                                                    </select>
                                                </div>
                                            </div>

                                            <div class="uk-width-medium-1-2">
                                                <label class="uk-form-label" for="student_id_number">身份证号码</label>
                                                <div class="uk-form-controls">
                                                    <input name="idNumber:string" class="uk-width-1-1" type="text" id="student_id_number" maxlength="18">
                                                </div>
                                            </div>

                                            <div class="uk-width-medium-1-2">
                                                <label class="uk-form-label" for="student_phone">手机号码</label>
                                                <div class="uk-form-controls">
                                                    <input name="phone:string" class="uk-width-1-1" type="tel" id="student_phone">
                                                </div>
                                            </div>

                                            <div class="uk-width-medium-1-2">
                                                <label class="uk-form-label" for="student_department">专业</label>
                                                <div class="uk-form-controls">
                                                    <select name="departmentId:number" class="uk-width-1-1" id="student_department">
                                                        <jsp:include page="../shared/department_options.jsp"/>
                                                    </select>
                                                    <%--<input name="student[departmentId]:number" class="uk-width-1-1" type="text" id="student_department">--%>
                                                </div>
                                            </div>

                                            <div class="uk-width-medium-1-2">
                                                <label class="uk-form-label" for="student_enrollment_year">入学年份</label>
                                                <div class="uk-form-controls">
                                                    <select name="enrollmentYear:number" class="uk-width-1-1" id="student_enrollment_year">
                                                        <c:forEach var="year" begin="${now.year + 1890}" end="${now.year + 1899}" step="1">
                                                            <option value="${year}">${year}</option>
                                                        </c:forEach>
                                                        <option value="${now.year + 1900}" selected>${now.year + 1900}</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </fieldset>

                                </form>

                                <form class="uk-form uk-margin" id="form_teacher_info">
                                    <fieldset>
                                        <div class="uk-grid" data-uk-margin id="teacher_profile">
                                            <div class="uk-width-medium-1-2">
                                                <label class="uk-form-label" for="teacher_no">工号</label>
                                                <div class="uk-form-controls">
                                                    <input name="teacherNumber:string" class="uk-width-1-1" type="text" id="teacher_no" maxlength="10" disabled>
                                                </div>
                                            </div>

                                            <div class="uk-width-medium-1-2">
                                                <label class="uk-form-label" for="teacher_name">姓名</label>
                                                <div class="uk-form-controls">
                                                    <input name="name:string" class="uk-width-1-1" type="text" id="teacher_name" maxlength="50">
                                                </div>
                                            </div>

                                            <div class="uk-width-medium-1-2">
                                                <label class="uk-form-label" for="teacher_birth_date">出生日期</label>
                                                <div class="uk-form-controls">
                                                    <input name="birthDate:string" class="uk-width-1-1" type=""
                                                           id="teacher_birth_date"
                                                           data-uk-datepicker="{weekstart: 0, format: 'YYYY-MM-DD', maxDate: 0}">
                                                </div>
                                            </div>

                                            <div class="uk-width-medium-1-2">
                                                <label class="uk-form-label" for="teacher_gender">性别</label>
                                                <div class="uk-form-controls">
                                                    <select name="gender:string" class="uk-width-1-1" id="teacher_gender">
                                                        <option value="M">男</option>
                                                        <option value="F">女</option>
                                                    </select>
                                                </div>
                                            </div>

                                            <div class="uk-width-medium-1-2">
                                                <label class="uk-form-label" for="teacher_id_number">身份证号码</label>
                                                <div class="uk-form-controls">
                                                    <input name="idNumber:string" class="uk-width-1-1" type="text" id="teacher_id_number" maxlength="18">
                                                </div>
                                            </div>

                                            <div class="uk-width-medium-1-2">
                                                <label class="uk-form-label" for="teacher_phone">手机号码</label>
                                                <div class="uk-form-controls">
                                                    <input name="phone:string" class="uk-width-1-1" type="tel" id="teacher_phone">
                                                </div>
                                            </div>

                                            <div class="uk-width-medium-1-2">
                                                <label class="uk-form-label" for="teacher_college">学院</label>
                                                <div class="uk-form-controls">
                                                    <select name="collegeId:number" class="uk-width-1-1" id="teacher_college">
                                                        <option value="0"></option>
                                                        <option value="1">计算机学院</option>
                                                        <option value="2">软件学院</option>
                                                    </select>
                                                </div>
                                            </div>

                                            <div class="uk-width-medium-1-2">
                                                <label class="uk-form-label" for="teacher_department">系</label>
                                                <div class="uk-form-controls">
                                                    <select name="departmentId:number" class="uk-width-1-1" id="teacher_department">
                                                        <option value="0"></option>
                                                    </select>
                                                </div>
                                            </div>

                                            <div class="uk-width-medium-1-2">
                                                <label class="uk-form-label" for="teacher_title">职称</label>
                                                <div class="uk-form-controls">
                                                    <select name="academicTitle:string" class="uk-width-1-1" id="teacher_title">
                                                        <option value="FP">教授</option>
                                                        <option value="AP">副教授</option>
                                                        <option value="UL">讲师 / 助理教授</option>
                                                    </select>
                                                </div>
                                            </div>

                                            <div class="uk-width-medium-1-2">
                                                <label class="uk-form-label" for="teacher_degree">最高学历</label>
                                                <div class="uk-form-controls">
                                                    <select name="highestDegree:string" class="uk-width-1-1" id="teacher_degree">
                                                        <option value="D">博士</option>
                                                        <option value="M">硕士</option>
                                                        <option value="B">学士</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                    </fieldset>
                                </form>
                            </div>
                            <div class="uk-modal-footer uk-text-right">
                                <button type="button" class="uk-button uk-modal-close">取消</button>
                                <button type="button" class="uk-button uk-button-primary" id="btn_save_account">保存</button>
                            </div>
                        </div>
                    </div>
                    <table class="uk-table uk-table-striped uk-table-hover">
                        <thead>
                        <tr>
                            <th></th>
                            <th>用户名</th>
                            <th>用户类型</th>
                            <th>姓名</th>
                            <th>详情</th>
                        </tr>
                        </thead>
                        <tbody id="tbody_account_list" class="uk-form">
                        </tbody>
                    </table>
                </article>
            </div>
        </div>
    </div>
</div>
</body>
</html>
